<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

require_once __DIR__.'/admin/Bootstrap.php';
require __DIR__.'/site2/config/config.inc.php';
require_once __DIR__.'/site2/includes/SearchMgr.class.php';
require_once(MYSQL);
$_page = new Templater(); 
$_main_content = new Templater();
include __DIR__.'/utils/prefix.php';

/**
 * start business logic from here
 */
$searchMgr= new SearchMgr($dbc,$_GET['searchTerm']);
$_main_content->load(__DIR__.'/site2/views/search/product/search.html');
$_main_content->set('searchTerm',$_GET['searchTerm']);
$_main_content->set('searchResult',$searchMgr->searchProducts());
$_main_content->set('allSearchTerms',$searchMgr->getAllSearchTerms());
$_page->load(__DIR__.'/site2/views/page/page.html');
$_page->set("content", $_main_content->parse());
$_page->publish();

